package com.xhsj.user.cram.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @Author: liuqinghua
 * @Description:机房出入申请开始传入参数
 * @Data:2021/4/19
 */
@Data
public class ComputerRoomAccessApplySaveDto{

    private Long id;
    /**
     * 节点id
     */
    @NotNull(message = "nodeId-节点id不能为空")
    private Long nodeId;

    /**
     * 事由
     */
    @NotBlank(message = "reason-事由不能为空")
    private String reason;

    /**
     * 进入时间
     */
    @NotBlank(message = "entryTime-进入时间不能为空")
    @JsonFormat(timezone = "GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private Date entryTime;

    /**
     * 出去时间
     */
    @NotBlank(message = "outTime-出去时间不能为空")
    @JsonFormat(timezone = "GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private Date outTime;

    /**
     * 机房出入人员
     */
    @NotBlank(message = "personnelList-机房出入人员不能为空")
    @Valid
    private List<ComputerRoomAccessPersonnelSaveDto> personnelList;
}
